package edu.neu.ecommerceplatform.dto;

import java.math.BigDecimal;

public class CategorySalesDto {

    private Long categoryId;
    private String categoryName;
    private BigDecimal totalSales;

    public CategorySalesDto() {
    }

    public CategorySalesDto(Long categoryId, String categoryName, BigDecimal totalSales) {
        this.categoryId = categoryId;
        this.categoryName = categoryName;
        this.totalSales = totalSales;
    }

    public void addSales(BigDecimal amount) {
        if (this.totalSales == null) {
            this.totalSales = BigDecimal.ZERO;
        }
        if (amount != null) {
            this.totalSales = this.totalSales.add(amount);
        }
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public BigDecimal getTotalSales() {
        return totalSales;
    }

    public void setTotalSales(BigDecimal totalSales) {
        this.totalSales = totalSales;
    }

}